#include <iostream>
using namespace std;

/*
    【题目214】设计一个哺乳动物类Mammal和一个鱼类Fish，并通过这两个类派生出鲸鱼类Whale，要求输出鲸鱼的体重数据。
*/

class Mammal
{
public:
    Mammal(int w)
    {
        weight = w;
    }
    void showWeight()
    {
        cout << "Mammal weight: " << weight << endl;
    }

private:
    int weight;
};

class Fish
{
public:
    Fish(int w)
    {
        weight = w;
    }
    void showWeight()
    {
        cout << "Fish weight: " << weight << endl;
    }

private:
    int weight;
};

class Whale : public Mammal, public Fish
{
public:
    Whale(int w) : Mammal(w), Fish(w)
    {
        weight = w;
    }

    void showWeight()
    {
        cout << "Whale weight: " << weight << endl;
    }

private:
    int weight;
};

int main()
{
    Whale w(1000);
    w.showWeight();
    w.Mammal::showWeight();
    w.Fish::showWeight();
    return 0;
}
